#include <iostream>
#include <vector>
using namespace std;

void frontdfs(vector<int> &v, int pos)
{
    if (pos == v.size())
        return;
    cout << v[pos] << " ";
    frontdfs(v, pos + 1);
}

void backdfs(vector<int> &v, int pos)
{
    if (pos == v.size())
        return;
    backdfs(v, pos + 1);
    cout << v[pos] << " ";
}

int main()
{
    vector<int> vv{1, 2, 3, 4, 5, 3, 27, 8, 45, 8, 54, 6, 9};

    // frontdfs(vv, 0);
    backdfs(vv, 0);

    return 0;
}